/**
 * 
 */
package unibo.lsb.test;

import java.util.ArrayList;
import java.util.List;

import unibo.lsb.logic.LastAssignedPenalty;
import unibo.lsb.logic.PlayerId;
import unibo.lsb.logic.PlayersTable;
import unibo.lsb.server.Game;
import unibo.lsb.server.GameImpl;

/**
 * @author Silvia Righini
 * 
 */
public class GameCreationUtilities {

	public static List<PlayerId> createListOfPlayers() {

		PlayerId shigu = new PlayerId("shigu", "", "192.136.12.4");
		PlayerId bea = new PlayerId("bea", "", "180.112.0.0");
		PlayerId luca = new PlayerId("luca", "", "133.136.54.1");
		PlayerId tommy = new PlayerId("tommy", "", "107.190.9.9");
		PlayerId rori = new PlayerId("rori", "", "23.13.0.2");

		// System.out.println(shigu.getIconNumber());
		// System.out.println(bea.getIconNumber());
		// System.out.println(luca.getIconNumber());
		// System.out.println(tommy.getIconNumber());

		List<PlayerId> l = new ArrayList<PlayerId>();
		l.add(shigu);
		l.add(bea);
		l.add(luca);
		l.add(tommy);
		l.add(rori);
		return l;
	}

	public static Game createGame() {
		List<PlayerId> l = createListOfPlayers();
		Game g = new GameImpl("SuperShiguGame", 5);
		g.setPlayersList(l);

		return g;
	}

	public void penaltyRandomAssign(List<PlayerId> l) {
		PlayersTable pt = new PlayersTable(l);

		LastAssignedPenalty p = new LastAssignedPenalty(l.get(2), 2);
		pt.computePenalty(p);
		pt.computePenalty(new LastAssignedPenalty(l.get(4), 1));
		pt.computePenalty(new LastAssignedPenalty(l.get(4), 12));
		System.out.println(pt.toString());
	}
}
